<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Controller;

use GatewayWorker\Lib\Session;

/**
 * Receipt 消息回执
 *
 * @author dongasai
 */
class Receipt
{

    /**
     * 基础处理 基本收到回执
     */
    public static function been_received($client_id, $data)
    {
        if (Login::is_login()) {
            $f_c = session('uid');
        } else {
            $f_c = $client_id;
        }
        if ($data['type'] == "ping") {
            $data['data']['s_d'] = microtime(TRUE) * 1000 - substr($data['data']['uqid'], 0, 13);
        }
        return \Data\Massage::receipt('been_received', $f_c, $data);
    }

}
